using MediatR;
using RBAC.ErrorCode;

namespace RBAC.Write.Api.Application.Command.ERP.SalesManagement
{
    /// <summary>
    /// 导出销售订单命令
    /// </summary>
    public class ExportSalesOrderCommand : IRequest<APIResult<byte[]>>
    {
        /// <summary>
        /// 页码（用于分批导出）
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页数量（导出记录数限制，默认1000条，最大10000条）
        /// </summary>
        public int PageSize { get; set; } = 1000;

        /// <summary>
        /// 订单编码
        /// </summary>
        public string? OrderCode { get; set; }

        /// <summary>
        /// 客户名称
        /// </summary>
        public string? CustomerName { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public string? OrderStatus { get; set; }

        /// <summary>
        /// 业务状态
        /// </summary>
        public string? BusinessStatus { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 销售人员
        /// </summary>
        public string? SalesPerson { get; set; }

        /// <summary>
        /// 排序字段（默认按创建时间倒序）
        /// </summary>
        public string OrderBy { get; set; } = "CreateTime DESC";

        /// <summary>
        /// 是否导出全部数据（忽略分页限制，谨慎使用）
        /// </summary>
        public bool ExportAll { get; set; } = false;
    }
}